#include "stdafx.h"
#include "wf_lockrelativezero.h"

#include "pf_snapper.h"
#include "pf_point.h"



WF_LockRelativeZero::WF_LockRelativeZero(
    PF_Container& container,
    PF_GraphicView& graphicView,
    bool on)
        :PF_ActionInterface("(Un-)lock the relative Zero",
                    container, graphicView) {

    this->on = on;
}


QAction* WF_LockRelativeZero::createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/) {
	// tr("(Un-)Lock Relative Zero"
    QAction* action = new QAction(tr("(Un-)&Lock Relative Zero"),  NULL);
    //action->zetStatusTip(tr("(Un-)Lock relative Zero"));
	action->setIcon(QIcon(":/extui/relzerolock.png"));
	action->setCheckable(true);
    return action;
}

void WF_LockRelativeZero::init(int status) {
    PF_ActionInterface::init(status);
    trigger();
    finish();
}

void WF_LockRelativeZero::trigger() {
    graphicView->lockRelativeZero(on);
}

// EOF
